<? $days = array('Mo','Di','Mi','Do','Fr','Sa','So'); ?>
<? foreach($action['schedule']['flow'] as $s) :?>
<div class="show" data-slug="<?= $s['show']; ?>" style="width:<?= $s['percent'];?>%; background-color:<?= $action['shows'][$s['show']]['color'];?>">
    <?= $s['show']; ?>
    <?= fillLeadingZero($s['hour']); ?>:<?= fillLeadingZero($s['minute']); ?>
</div>
<? endforeach; ?>
<div class="show-indicator">
    <i class="fa fa-caret-down"></i>
</div>
<div class="timetable">
<? for($i=0; $i<7; $i++) :?>
    <div class="week-row">
        <div class="week">
            <? foreach($action['week_schedule'][$i] as $k=>$s) :?>
            <?
                $show       = $action['shows'][$s['show']];
                $podcast    = $action['podcasts'][$show['podcast']['slug']]; 
            ?>
            <div class="show <?= $s['class']; ?>" data-slug="<?= $s['show']; ?>" style="width:<?= $s['percent'];?>%; background-color:<?= $action['shows'][$s['show']]['color'];?>">
                <? if($k==count($action['week_schedule'][$i])-1) :?><span class="up-to">
                    bis <?= date('H:i',$s['end_ts']); ?>
                </span>
                <? endif;?>
                <?= $s['show']; ?><br />
                <? if($s['class']!='tail') : ?>
                <?= fillLeadingZero($s['hour']); ?>:<?= fillLeadingZero($s['minute']); ?>
                <? endif; ?>
                <? if($show['podcast']['every_nth_song']>0) : ?>
                <br />
                <span class="podcast"><?= $podcast['name']; ?></span>
                <? endif; ?>
            </div>
            <? endforeach; ?>
        </div>
        <div class="weekday">
            <?= $days[$i]; ?>
        </div>
    </div>
<? endfor; ?>
</div>
<script>
    var ALL_OVER_DURATION = <?= $action['schedule']['all_over_duration']; ?>;
    var YESTERDAY_DURATION = <?= $action['schedule']['yesterday_duration']; ?>;
</script>